package com.yenlien.traceyun.plant.dao;

import com.yenlien.traceyun.plant.entity.InputsLog;
import com.yenlien.traceyun.webase.dao.BaseJpaDao;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface InputsLogDao extends BaseJpaDao<InputsLog> {

    List<InputsLog> findByInputsId(String inputsId);


    @Query(value = "SELECT SUM(CONVERT(`number`, SIGNED))  FROM t_plant_inputs_log  WHERE type = 1 AND inputs_id = ?1", nativeQuery = true)
    String getUseNum(String inputsId);

}
